home *** CD-ROM | disk | FTP | other *** search
- Path: ifi.uio.no!usenet
- From: ludvigp@ifi.uio.no (Ludvig Pedersen)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: PPC compilers
- Date: 25 Jan 1996 11:36:25 GMT
- Organization: Dept. of Informatics, University of Oslo, Norway
- Message-ID: <1205.6597T1252T932@ifi.uio.no>
- References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au> <38232132@kone.fipnet.fi>
- NNTP-Posting-Host: gymir.ifi.uio.no
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
-
-
- >> To do fast 16:16 bit fixed point maths (ie for bitmap scaling). You have
- >> the fraction in the high word and the integer part in the low word.
- >>áBecause of the addx, every time the fraction wraps around, the X bit is set
- >>áand next add, the integer bit is incremented.
- >Addx is really great .. Hmm. We could think of all the
- >situations where addx could possibly go wrong. (I mean
- >fixed point interpolations)
- >At least this has to be done before the loop:
- > moveq #0,d0
- > add.l d1,d0
-
- > ...
- >.loop addx.l d1,d2
- > dbf d7,.loop
-
- >But what about if there is two addx? Theis decimal parts
- >have to be switched, which is done nicely with eor
- >before swapping, but what about that before loop
- >correction? Of course this perfect accuracy
- >is not required on 16.16 fixed point but if
- >there is a smaller amount of fraction, the
- >errors can be quite big..
-
- Using
- sub.w dx,dx
-
- instead of
-
- moveq #0,d0
- add.l d1,d0
-
- is faster by-the-way. And since we are only using the lower word of the
- register we don't need to use an extra dataregister.
-
- <sb>Ludde - Amiga Demo Coder
- <sb>Virtual Reality & Official Be developer
- <sb>ludvigp@ifi.uio.no
-
-